﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ongoal.Quotation.Http
{
    /// <summary>
    /// 
    /// </summary>
    public interface IMircoServiceClient
    {

        /// <summary>
        /// 请求数据
        /// </summary>
        /// <param name="url">相对路径</param>
        /// <param name="httpMethod">请求方式</param>
        /// <param name="postData">请求数据</param>
        /// <param name="contentType">请求正文类型</param>
        /// <param name="timeOut">超时设置</param>
        /// <param name="headers">请求头设置</param>
        /// <returns></returns>
        string SendRequest(string url, HttpMethod httpMethod, object postData, ContentType contentType = ContentType.Json, int timeOut = 30, Dictionary<string, string> headers = null);

        /// <summary>
        /// 异步请求Post数据
        /// </summary>
        /// <param name="url">相对路径</param>
        /// <param name="httpMethod">请求方式</param>
        /// <param name="postData">请求数据</param>
        /// <param name="contentType">请求正文类型</param>
        /// <param name="timeOut">超时设置</param>
        /// <param name="headers">请求头设置</param>
        /// <returns></returns>
        Task<string> SendRequestAsync(string url, HttpMethod httpMethod, object postData, ContentType contentType = ContentType.Json, int timeOut = 30, Dictionary<string, string> headers = null);
    }
}
